<?php

App::uses('AppModel', 'Model');

class Activity extends AppModel {
	
	public $name = 'Activity';
	
	public $belongsTo = array(
		'Conductor' => array(
			'className' => 'Conductor',
			'foreignKey' => 'conductor_member_id'
		)
	);
	
	public $hasAndBelongsToMany = array(
		'Member' => array(
			'className' => 'Member',
			'fields' => array('id', 'firstname', 'surname'),
			'joinTable' => 'members_activities',
			'foreignKey' => 'activity_id',
			'associationForeignKey' => 'member_id',
			'order' => 'firstname, surname',
			'uniquie' => true
		)
	);
	
}
